/*
(***************************************************************************)
(*                                                                         *)
(*                     Fast Wavelet Transform Library                      *)
(*                                                                         *)
(* Release Version 0.0.1                                                   *)
(* Copyright (c) 2007-2008 Yuriy Chesnokov                                 *)
(* Copyright (c) 2008 Arash Partow                                         *)
(* All Rights Reserved.                                                    *)
(*                                                                         *)
(* The Fast Wavelet Transform Library and all its components are supplied  *)
(* under the terms of the General Public License. The contents of the      *)
(* Fast Wavelet Transform Library and all its components may not be copied *)
(* or disclosed except in accordance with the terms of that agreement.     *)
(*                                                                         *)
(* URL: http://www.gnu.org/licenses/gpl.txt                                *)
(*                                                                         *)
(***************************************************************************)
*/


#include <iostream>
#include <string>

#include "fwt2d.hpp"
#include "vec1d.hpp"
#include "wavelet_utils.hpp"


template<typename T>
void test(const std::string& type_name,
          const unsigned int& width,
          const unsigned int& height)
{
   const unsigned int frame_count = 10;
   fwt2d<T> wt("filters/bior97.flt");
   wt.init(width,height);
   T* data = new T[width * height];
   timer time;
   time.start();
   for(std::size_t i = 0; i < frame_count; ++i)
   {
      wt.transform(data,3,0);
      wt.synthesize(data);
   }
   time.stop();
   std::cout << type_name<< "[" << width << "," << height <<"] Rate: " << (1.0 * frame_count) / time.time() << "fps" << std::endl;
   delete [] data;
}


int main(void)
{
   test<float>("float",640,480);
   test<float>("float",1024,1024);
   test<double>("double",640,480);
   test<double>("double",1024,1024);
   return 0;
}
